package com.hb.trade.server.project.evaluation.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hb.core.pojo.project.evaluation.dto.*;
import com.hb.core.pojo.project.evaluation.entity.EvaluationThird;
import com.hb.core.pojo.project.evaluation.vo.EvaluationReusableScoreItemVO;
import org.fzzn.core.model.msg.Message;
import com.hb.core.pojo.project.evaluation.vo.EvaluationReviewItemResultVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 专家三级评审表 服务类
 * </p>
 *
 * @author zhaojk
 * @since 2022-04-13
 */
public interface EvaluationThirdService extends IService<EvaluationThird> {

    /**
     * 获取评审项下的所有评审结果信息
     *
     * @param evaluationReviewItemParam
     * @return
     */
    EvaluationReviewItemResultVO allResultOfReviewPoint(EvaluationReviewItemParam evaluationReviewItemParam);

    /**
     * 根据标段id,评审点id和专家id获取所有公司的评审结果
     *
     * @param reviewPointId
     * @param expertId
     * @return
     */
    List<EvaluationThirdDTO> resultOfReviewPoint(Long sectionId, Long reviewPointId, Long expertId);


    /**
     * 根据标段id,二级评审项获得所有的评审点
     *
     * @param secondReviewItemId 二级评审项id
     * @param sectionId标段id
     * @return
     */
    List<EvaluationThirdDTO> resultOfReviewPoint(Long sectionId, Long secondReviewItemId);

    /**
     * 根据标段id,二级评审项获得所有的评审点
     *
     * @param sectionId           标段id
     * @param secondReviewItemId  二级评审项id
     * @param firstReviewItemType 评审项类型
     * @return
     */
    List<EvaluationThirdDTO> listEvaluationThirdDTO(Long sectionId, Long secondReviewItemId, Integer firstReviewItemType);

    /**
     * 判断提交的数据是否有已汇总的
     *
     * @param idList
     * @return
     */
    Boolean evaluationThirdHaveSummaryData(List<Long> idList);

    /**
     * 批量通过
     *
     * @param evaluationSubmitScoreParamList
     * @return
     */
    Boolean batchPass(List<EvaluationSubmitScoreParam> evaluationSubmitScoreParamList);

    /**
     * 批量拒绝
     *
     * @param evaluationSubmitScoreParamList
     * @return
     */
    Boolean batchRefuse(List<EvaluationSubmitScoreParam> evaluationSubmitScoreParamList);

    /**
     * 保存单个企业的单个评审点的评标结果
     *
     * @param evaluationSubmitScoreParam
     * @return
     */
    Boolean saveScoreOfReviewPointSingleOrg(EvaluationSubmitScoreParam evaluationSubmitScoreParam);

    /**
     * 保存批量评标结果
     *
     * @param evaluationSubmitScoreParamList
     * @return
     */
    Boolean saveScoreBatch(List<EvaluationSubmitScoreParam> evaluationSubmitScoreParamList);

    /**
     * 提交单个评审点的评标结果
     *
     * @return
     */
    Boolean submitScoreOfReviewPoint(List<EvaluationSubmitScoreParam> evaluationSubmitScoreParamList);

    /**
     * 提交并共享单个评审点的评标结果
     *
     * @param evaluationSubmitScoreParamList
     * @return
     */
    Boolean submitAndShareScoreOfReviewPoint(List<EvaluationSubmitScoreParam> evaluationSubmitScoreParamList);

    /**
     * 提交评审项下所有评审点的评标结果
     *
     * @return
     */
    Boolean submitScoreOfReviewItem(List<EvaluationSubmitScoreParam> evaluationSubmitScoreParamList);


    /**
     * 修改二级，三级 报价评审的状态为待评审
     *
     * @param evaluationThirdId 三级评审id
     * @author tian
     * @date 2022-4-23 11:32
     */
    void editEvaluationStatusByOfferReview(Long evaluationThirdId);

    /**
     * 获取可复用评审信息
     *
     * @param evaluationReviewPointParam
     * @return
     */
    List<EvaluationReusableScoreItemVO> reusableScoreOfReviewPoint(EvaluationReviewPointParam evaluationReviewPointParam);

    /**
     * 确认汇总
     *
     * @param evaluationReviewItemParam
     * @return
     */
    Boolean confirmResultSummary(EvaluationReviewItemParam evaluationReviewItemParam);

    /**
     * 复核
     *
     * @param
     * @return
     */
    Boolean recheckResultSummary(Long sectionId, Long reviewItemId);


    /**
     * 查询报价评审
     *
     * @param evaluationReviewItemParam
     * @return org.fzzn.core.model.msg.Message<java.util.Map>
     * @author tian
     * @date 2022-4-20 15:09
     */
    Message<Map> findQuotationReview(EvaluationReviewItemParam evaluationReviewItemParam);

    /**
     * 非组长 确认报价
     *
     * @param evaluationReviewItemParam
     * @return org.fzzn.core.model.msg.Message<java.lang.String>
     * @author tian
     * @date 2022-4-20 15:36
     */
    Message<String> confirmOffer(EvaluationReviewItemParam evaluationReviewItemParam);

    /**
     * 获取被淘汰的企业列表id
     *
     * @param sectionId
     * @param reviewItemId
     * @return
     */
    List<Long> findOrgIdListEliminate(Long sectionId, Long reviewItemId);

    /**
     * 更新企业的淘汰状态
     * @param sectionId
     * @param reviewItemId
     * @param idList
     * @return
     */
    Boolean saveOrgEliminateStatus(Long sectionId, Long reviewItemId, List<Long> idList);

    /**
     * 取消企业淘汰状态
     * @param sectionId
     * @param reviewItemId
     * @return
     */
    Boolean cancelOrgEliminateStatus(Long sectionId, Long reviewItemId);
}
